package com.service;

import com.mapper.CourseStyleMapper;
import com.pojo.Course;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class CourseStyleServiceImpl implements CourseStyleService {

    @Autowired
    private CourseStyleMapper courseStyleMapper;




    //    增加
    public boolean addCourseStyle(Course course) {
        if(courseStyleMapper.addCourseStyle(course)>0){
            return true;
        }
        return false;
    }

//    删除
    public boolean deleteCourseStyle(Integer cId) {
        if(courseStyleMapper.deleteCourseStyle(cId)>0){
            return true;
        }
        return false;
    }

//    修改
    public boolean updateCourseStyle(Course course) {
        if(courseStyleMapper.updateCourseStyle(course)>0){
            return true;
        }
        return false;
    }

//    查看全部
    public List<Course> showCourseStyleList() {
        List<Course> list = courseStyleMapper.showCourseStyleList();
        return list;
    }

//    模糊查询
    public List<Course> findCourseStyleCname(String cName, String fukuan) {

        return courseStyleMapper.findCourseStyleCname(cName,fukuan);
    }

//    查看单个
    public Course findCourseStyleById(Integer cId) {
        Course courseStyleById = courseStyleMapper.findCourseStyleById(cId);
        return courseStyleById;
    }
}
